#include<bits/stdc++.h>
using namespace std;
int n,r[900001],too[500001]={},mx=-100000000,mn=100000000,ext,ans=0;
int main(){
	freopen("duel.in","r",stdin);
	freopen("duel.out","w",stdout);
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>r[i];
		too[r[i]]++;
		mx=max(mx,r[i]);
		mn=min(mn,r[i]);
	}
	ext=mn;
	for(int i=mn+1;i<=mx;++i){
		if(too[i]==0){
			continue;
		}
		if(too[i]>=1){
			if(too[i]>=too[ext]){
				too[ext]=0;
			}
			else if(too[i]<too[ext]){
				too[ext]-=too[i];
			}
			ext=i;
		}
		
	}
	for(int i=mn;i<=mx;i++){
		ans+=too[i];
	}
	cout<<ans<<endl;
	return 0;
}	
